package com.lipuwater.agent.ui.activity.after;

import android.graphics.Color;

import com.lipuwater.agent.R;
import com.lipuwater.agent.app.base.adapter.BaseListAdapter;
import com.lipuwater.agent.app.base.ui.BaseListActivity;
import com.lipuwater.agent.app.base.utils.ListSettings;
import com.lipuwater.agent.http.bean.after.FaultInfoBean;
import com.lipuwater.agent.ui.adapter.after.ATAfterDevFaultAdapter;

import java.util.List;


/**
 * 订单明细
 */
public class AfterFaultListActivity extends BaseListActivity<FaultInfoBean> {

    private List<FaultInfoBean> mData;

    @Override
    protected void OnViewCreated() {
        toolbar.setBackgroundResource(R.drawable.img_title_bar);
        initTitle(R.drawable.icon_aleft_white, "设备故障");
        toolbarTitle.setTextColor(Color.parseColor("#ffffff"));
        mData = (List<FaultInfoBean>) getIntent().getSerializableExtra("faultList");
        if (mData == null && mData.size() == 0 && mData.get(0) == null) {
            mData = null;
        }
    }

    @Override
    public void requestData(boolean needRefresh) {
        onDataLoaded(mData);
    }

    @Override
    protected BaseListAdapter<FaultInfoBean> getListAdapter() {
        return new ATAfterDevFaultAdapter(this);
    }

    @Override
    protected ListSettings getBaseSettings() {
        ListSettings settings = new ListSettings();
        settings.setCanRefresh(false);
        settings.setCanLoadMore(false);
        return settings;
    }
}
